package com.thrift.server.service.impl;

import com.thrift.server.entity.Student;
import com.thrift.server.service.StudentService;
import org.springframework.stereotype.Service;

/**
 * @author 何锦涛--CodeSleep
 * @since 2022/9/4 20:08
 */
@Service
public class StudentServiceImpl implements StudentService {

    @Override
    public Student getStudentByName(String name) {
        System.out.println("服务端收到客户端获取用户名: " + name + " 信息");
        Student student = new Student();
        // 模拟数据
        student.setName(name);
        student.setAge(30);
        student.setAddress("成都");
        System.out.println("模拟获取成功并返回：" + student);
        return student;
    }

    @Override
    public void saveStudent(Student student) {
        System.out.println("服务端收到客户端请求保存学生信息：" + student);
        System.out.println("模拟保存成功!!!");
    }
}
